package com.caiheng.api.service.estate;

import com.caiheng.api.entity.estate.EstateUser;
import com.caiheng.api.entity.estate.RepairRecord;
import com.caiheng.api.entity.sys.SysUser;
import com.caiheng.api.entity.wxuser.User;
import com.caiheng.api.service.base.BaseService;

import java.util.List;

/**
 * 报修记录Service接口
 *
 * @author ruoyi
 * @date 2021-08-21
 */
public interface RepairRecordService extends BaseService<RepairRecord> {

    /**
     *  添加报修记录
     * @param user
     * @param repairRecord
     * @return
     */
    int addRecord(User user,RepairRecord repairRecord);


    /**
     *  指派维修师傅
     * @param user
     * @param repairRecord
     * @return
     */
    int setWorker(User user,RepairRecord repairRecord);


    /**
     *  抢单操作
     * @param user
     * @param repairRecord
     * @return
     */
    int pickOp(User user,SysUser sysUser, EstateUser estateUser, RepairRecord repairRecord);


    /**
     *  处理报修记录
     * @param user
     * @param repairRecord
     * @return
     */
    int handleRecord(User user, SysUser sysUser, EstateUser estateUser, String content, RepairRecord repairRecord);


    /**
     *  业主评价
     * @param user
     * @param repairRecord
     * @return
     */
    int appraiseOp(User user, String content, RepairRecord repairRecord);

    /**
     *  获取报修详情
     * @param record_id
     * @return
     */
    RepairRecord getRepairById(int record_id);

    /**
     *  获取用户的上报记录
     * @param user_id
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<RepairRecord> selectByUserId(Integer user_id, EstateUser estateUser,Integer state, Integer pageIndex,Integer pageSize);

    /**
     *  获取物业经理或者维修人员的上报记录
     * @param user_id
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<RepairRecord> selectEstateByUserId(Integer user_id, SysUser sysUser, EstateUser estateUser, Integer state, Integer pageIndex, Integer pageSize);


    /**
     *  我抢到的报事报修的列表
     * @param user_id
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<RepairRecord> selectMyPickList(Integer user_id, SysUser sysUser, EstateUser estateUser, Integer state, Integer pageIndex, Integer pageSize);



    /**
     *  获取 抢单列表 上报记录
     * @param estateId
     * @param pageIndex
     * @param pageSize
     * @return
     */
    List<RepairRecord> selectByEstateId(Integer estateId, Integer state, Integer pageIndex, Integer pageSize);

}
